package com.itheima.d7_collections;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Collections工具类(方法都是静态 直接类名调用)
 */
public class CollectionsDemo2 {
    public static void main(String[] args) {
        //创建一个集合
        List<String> list = new ArrayList<>();
//        list.add("左右");
//        list.add("齐静春");
//        list.add("阿良");
//        System.out.println( list);

        //1.通过调用Collections工具类来实现 addAll()
        Collections.addAll(list,"左右","齐静春","阿良","阮邛");
        System.out.println(list);

        //2.shuffle() 打乱顺序
        Collections.shuffle(list);
        System.out.println(list);
    }
}
